<!DOCTYPE html>
<html class="x-admin-sm">

	<head>
		<meta charset="UTF-8">
		<title>欢迎页面-stpm v1.0</title>
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
		<link rel="stylesheet" href="../css/font.css">
		<link rel="stylesheet" href="../css/xadmin.css">
		<script src="../lib/layui/layui.js" charset="utf-8"></script>
		<script type="text/javascript" src="../js/xadmin.js"></script>
		<!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
		<!--[if lt IE 9]>
          <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
          <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
        <![endif]-->
	</head>

	<body>
		<div class="x-nav">
				<span class="layui-breadcrumb">
				<a href="javascript:;">首页</a>
				</span>
			<a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"
			   onclick="location.reload()" title="刷新">
				<i class="layui-icon layui-icon-refresh" style="line-height:30px"></i></a>
		</div>
		<div style="padding-top: 15px">
			<div class="layui-row layui-col-space15">
				<div class="layui-row layui-col-space15 layui-col-md8">
					<div class="layui-col-md12">
						<div class="layui-col-md3">
							<div class="layui-card" style="height: 250px;">
								<div class="layui-card-header">
									<h3>时间线</h3>
								</div>
								<div class="layui-card-body" >
									<ul class="layui-timeline">
										<li class="layui-timeline-item ">
											<i class="layui-icon layui-timeline-axis">&#xe63f;</i>
											<div class="layui-timeline-content layui-text">
												<div class="layui-timeline-title">1.创建账号</div>
											</div>
										</li>
										<li class="layui-timeline-item ">
											<i class="layui-icon layui-timeline-axis">&#xe63f;</i>
											<div class="layui-timeline-content layui-text">
												<div class="layui-timeline-title">2.创建项目</div>
											</div>
										</li>
										<li class="layui-timeline-item ">
											<i class="layui-icon layui-timeline-axis">&#xe63f;</i>
											<div class="layui-timeline-content layui-text">
												<div class="layui-timeline-title">3.创建团队</div>
											</div>
										</li>
										<li class="layui-timeline-item ">
											<i class="layui-icon layui-timeline-axis">&#xe63f;</i>
											<div class="layui-timeline-content layui-text">
												<div class="layui-timeline-title">4.指派任务</div>
											</div>
										</li>
									</ul>
								</div>
							</div>
						</div>
						<div class="layui-col-md9">
							<div class="layui-card" style="height: 250px;">
								<div class="layui-card-header">
									<h3>剩余的工作</h3></div>
								<div class="layui-card-body">
									<ul class="layui-row layui-col-space10 layui-this x-admin-carousel x-admin-backlog" style="padding-top: 30px;">
										<li class="layui-col-md3 layui-col-xs6">
											<a href="javascript:;" class="x-admin-backlog-body">
												<h3>任务量</h3>
												<p><cite id="totalTask">0</cite></p>
											</a>
										</li>
										<li class="layui-col-md3 layui-col-xs6">
											<a href="javascript:;" class="x-admin-backlog-body">
												<h3>问题单</h3>
												<p><cite id="totalBug">0</cite></p>
											</a>
										</li>
										<li class="layui-col-md3 layui-col-xs6">
											<a href="javascript:;" class="x-admin-backlog-body">
												<h3>项目</h3>
												<p><cite id="totalProject">0</cite></p>
											</a>
										</li>
										<li class="layui-col-md3 layui-col-xs6">
											<a href="javascript:;" class="x-admin-backlog-body">
												<h3>我的代办</h3>
												<p><cite id="totalTodo">0</cite></p>
											</a>
										</li>
									</ul>
								</div>
							</div>
						</div>
					</div>
				</div>
				<div class="layui-row layui-col-md4">
					<div class="layui-col-md12">
						<div class="layui-card" style="height: 250px">
							<div class="layui-card-header">我的代办</div>
							<div class="layui-card-body ">
								<table class="layui-hide" id="todoTable"></table>
							</div>
						</div>
					</div>
				</div>
				<div class="layui-row layui-col-space15 layui-col-md12">
					<!--流程图开始-->
					<div class="layui-col-md12">
						<div class="layui-card">
							<div class="layui-card-header">
								<h3>流程图</h3>
							</div>
							<div class="layui-card-body">
								<ul class="layui-row layui-col-space10 layui-this x-admin-carousel x-admin-backlog">
									<li class="layui-col-md2 layui-col-xs6">
										<div class="x-admin-backlog-body">
											管理员
										</div>
									</li>
									<li class="layui-col-md2 layui-col-xs6">
										<div class="x-admin-backlog-body">
											添加用户
										</div>
									</li>
									<li class="layui-col-md2 layui-col-xs6">
										<div class="x-admin-backlog-body">
											编辑用户
										</div>
									</li>
									<li class="layui-col-md2 layui-col-xs6">
										<div class="x-admin-backlog-body">
											删除用户
										</div>
									</li>
								</ul>
								<ul class="layui-row layui-col-space10 layui-this x-admin-carousel x-admin-backlog">
									<li class="layui-col-md2 layui-col-xs6">
										<div class="x-admin-backlog-body">
											项目经理
										</div>
									</li>
									<li class="layui-col-md2 layui-col-xs6">
										<div class="x-admin-backlog-body">
											创建项目
										</div>
									</li>
									<li class="layui-col-md2 layui-col-xs6">
										<div class="x-admin-backlog-body">
											维护团队
										</div>
									</li>
									<li class="layui-col-md2 layui-col-xs6">
										<div class="x-admin-backlog-body">
											指派任务
										</div>
									</li>
								</ul>
								<ul class="layui-row layui-col-space10 layui-this x-admin-carousel x-admin-backlog">
									<li class="layui-col-md2 layui-col-xs6">
										<div class="x-admin-backlog-body">
											开发人员
										</div>
									</li>
									<li class="layui-col-md2 layui-col-xs6">
										<div class="x-admin-backlog-body">
											领取任务
										</div>
									</li>
									<li class="layui-col-md2 layui-col-xs6">
										<div class="x-admin-backlog-body">
											查询问题单
										</div>
									</li>
									<li class="layui-col-md2 layui-col-xs6">
										<div class="x-admin-backlog-body">
											完成任务
										</div>
									</li>
									<li class="layui-col-md2 layui-col-xs6">
										<div class="x-admin-backlog-body">
											完成问题单
										</div>
									</li>
								</ul>
								<ul class="layui-row layui-col-space10 layui-this x-admin-carousel x-admin-backlog">
									<li class="layui-col-md2 layui-col-xs6">
										<div class="x-admin-backlog-body">
											测试人员
										</div>
									</li>
									<li class="layui-col-md2 layui-col-xs6">
										<div class="x-admin-backlog-body">
											领取任务
										</div>
									</li>
									<li class="layui-col-md2 layui-col-xs6">
										<div class="x-admin-backlog-body">
											提交问题单
										</div>
									</li>
									<li class="layui-col-md2 layui-col-xs6">
										<div class="x-admin-backlog-body">
											指派问题单
										</div>
									</li>
									<li class="layui-col-md2 layui-col-xs6">
										<div class="x-admin-backlog-body">
											管理问题单
										</div>
									</li>
								</ul>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<script>
			layui.use(['table','layer'], function() {
				var table = layui.table;
				var $=layui.jquery;
				var layer=layui.layer;
				//
				table.render({
					elem: '#todoTable'
                    ,url: 'http://localhost:8080/todo/mytodo' //数据接口
					,cellMinWidth: 80 //全局定义常规单元格的最小宽度，layui 2.2.1 新增,
					,cols: [[
						{field:'todoEndDate',width:'40%',minWidth: 100,title:'日期',sort:true}
						,{field:'todoPriority',width:'20%',minWidth: 80,title:'级别',sort:true}
						,{field:'todoName',width: '40%', minWidth: 100,title:'任务标题',sort:true}
					]]
				});
				$.ajax({
					type:"GET",
					url:"http://localhost:8080/task/total",
					xhrFields:{withCredentials:true},
					success:function(data){
						if(data.status=="success"){
                            document.getElementById("totalTask").innerText=data.data.totalTask;
                            document.getElementById("totalBug").innerText=data.data.totalBug;
                            document.getElementById("totalProject").innerText=data.data.totalProject;
                            document.getElementById("totalTodo").innerText=data.data.totalTodo;
						}else{
                            layer.msg(data.data.errMsg, {
                                icon: 5,
                                time:2000
                            });
						}
					},
					error:function(data){
                        layer.msg(data.data.errMsg, {
                            icon: 5,
                            time:2000
                        });
					},
				});
			});
		</script>
	</body>

</html>